<?
include_once('./include/common.inc.php');
if ($_GET['act']=='logout') {
	session_start();
	session_destroy();
	//session_unregister('admininfo');
	header('Location:/'.$virdir.'index.php');
}
require_once ("./xajax/inc/xajax.inc.php");
$xajax = new xajax('/'.$virdir.'class/admin.class.php');
//管理员登录
$xajax->registerFunction('login');
//显示管理首页
$xajax->registerFunction('getIndexPage');
//关闭站点
$xajax->registerFunction('closeSite');
//打开站点
$xajax->registerFunction('openSite');
//显示基本设置
$xajax->registerFunction('loadSettings');
//保存基本设置
$xajax->registerFunction('saveSettings');
//显示分类设置
$xajax->registerFunction('loadCategories');
//保存分类设置
$xajax->registerFunction('saveCategories');
//显示用户组
$xajax->registerFunction('loadUserGroups');
//保存用户组
$xajax->registerFunction('saveUserGroup');
//显示表情
$xajax->registerFunction('loadSmilies');
//保存表情
$xajax->registerFunction('saveSmilies');
//显示过虑器
$xajax->registerFunction('loadWordFilter');
//保存过虑器
$xajax->registerFunction('saveWordFilter');
//显示公告
$xajax->registerFunction('loadAnnounce');
//保存公告
$xajax->registerFunction('saveAnnounce');
$ajaxscript=$xajax->getJavascript('/'.$virdir.'xajax/inc/');
$smarty->assign('ajaxscript',$ajaxscript);

$admin = isAdmin();
//print_r($admin);
//alert($admin);
$smarty->assign('adminpage',1);
if ($admin==-1) {
	if ($webstate!=1) {
		$smarty->display('adminlogin.tpl');
		exit();
	}else {
		header('Location:/'.$virdir.'index.php');
	}
}
if ($admin==0) {
	$smarty->display('adminlogin.tpl');
	exit();
}
$smarty->assign('loading',$lang['LOADING']);
$smarty->display('adminindex.tpl');
//ajax处理相关操作

?>